-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Layout Editor running out of repositionable controls #958
Conversation
I need this. Thank you so much. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the config into RscDisplayOptionsLayout.hpp
and include that file.
Does Vanilla really start with Element000 ? |
Done, and yeah |
class Element021; | ||
#define ADD_ELEMENT(var1) class Element##var1: Element021 {\ | ||
idc = __EVAL(12000 + var1);\ | ||
onMouseEnter = "with uinamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};";\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are the same config values set in each element? Aren't they inherited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Eventhandlers are added by script. So no Element000->021 doesn't have them so we need to add them. Which is what's happening here.
But how about we just make Element022 with the Eventhandlers and just have all the others inherit from that? Less code in the preprocessed config in the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will take a look at the master config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how it looks in the displays init script:
// RscDisplayOptionsLayout.sqf
...
for "_i" from 0 to 21 do {
_control = _display displayctrl (IDCBASE + _i);
_control ctrladdeventhandler ["mouseenter","with uinamespace do {['mouseEnter',_this,''] call RscDisplayOptionsLayout_script;};"];
_control ctrladdeventhandler ["mouseexit","with uinamespace do {['mouseExit',_this,''] call RscDisplayOptionsLayout_script;};"];
_control ctrladdeventhandler ["mouseholding","with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"];
_control ctrladdeventhandler ["mousemoving","with uinamespace do {['mouseMoving',_this,''] call RscDisplayOptionsLayout_script;};"];
_control ctrladdeventhandler ["mousebuttondown","with uinamespace do {['mouseButtonDown',_this,''] call RscDisplayOptionsLayout_script;};"];
_control ctrladdeventhandler ["mousebuttonup","with uinamespace do {['mouseButtonUp',_this,''] call RscDisplayOptionsLayout_script;};"];
};
...
Strangely, in a few other places it just iterates through the child classes instead of assuming 0...21. /shrug
When merged this pull request will: